using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using Bussiness.Config;     
using Bussiness.Entity;
namespace Bussiness.ManagerBase
{
                

     public abstract class PT_FormManagerBase
    {
        public PT_FormManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity Insert(PT_FormEntity obj)
        { 
            return (PT_FormEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity Update(PT_FormEntity obj)
        { 
            return (PT_FormEntity)Adapter.Update(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo dieu kien trong object
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity UpdateWithCondition(PT_FormEntity obj,PT_FormEntity objCond)
        { 
            return (PT_FormEntity)Adapter.UpdateWithCondition(obj,objCond);             
        }
 
 
        public PT_FormEntity Delete(PT_FormEntity obj)
        { 
            return (PT_FormEntity)Adapter.Delete(obj);             
        }
 
 
        public PT_FormEntity DeleteWithCondition(PT_FormEntity objCond)
        { 
            return (PT_FormEntity)Adapter.DeleteWithCondition(objCond);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien FormName duoc set trong object
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity DeleteByFormName (PT_FormEntity obj)
        { 
            return (PT_FormEntity)Adapter.DeleteByField(obj,"FormName");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien FormName 
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity DeleteByFormName (string FormName )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormName = FormName;  
            return (PT_FormEntity)Adapter.DeleteByField(obj,"FormName");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien FormTitle duoc set trong object
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity DeleteByFormTitle (PT_FormEntity obj)
        { 
            return (PT_FormEntity)Adapter.DeleteByField(obj,"FormTitle");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien FormTitle 
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity DeleteByFormTitle (string FormTitle )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormTitle = FormTitle;  
            return (PT_FormEntity)Adapter.DeleteByField(obj,"FormTitle");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity DeleteByOrderIndex (PT_FormEntity obj)
        { 
            return (PT_FormEntity)Adapter.DeleteByField(obj,"OrderIndex");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien OrderIndex 
        /// </summary>
        /// <returns>PT_FormEntity</returns>
        public PT_FormEntity DeleteByOrderIndex (int OrderIndex )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.OrderIndex = OrderIndex;  
            return (PT_FormEntity)Adapter.DeleteByField(obj,"OrderIndex");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public PT_FormEntity Select(PT_FormEntity obj)
        { 
            return (PT_FormEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_FormEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(PT_FormEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new PT_FormEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new PT_FormEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_FormEntity> SelectAllLST()
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_FormEntity()),new PT_FormEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<PT_FormEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new PT_FormEntity(),option),new PT_FormEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormName (PT_FormEntity obj)
        { 
            return Adapter.SelectByField(obj,"FormName");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormName (PT_FormEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"FormName",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectByFormNameLST (PT_FormEntity obj)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FormName"),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectByFormNameLST (PT_FormEntity obj,SelectOptions option)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"FormName",option),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormName (string FormName )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormName = FormName;  
            return Adapter.SelectByField(obj,"FormName");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormName (string FormName, SelectOptions option)
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormName = FormName;  
            return Adapter.SelectByField(obj,"FormName",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_FormEntity> SelectByFormNameLST (string FormName )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormName = FormName;  
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FormName"),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormName duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_FormEntity> SelectByFormNameLST (string FormName, SelectOptions option)
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormName = FormName;  
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FormName",option),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormTitle (PT_FormEntity obj)
        { 
            return Adapter.SelectByField(obj,"FormTitle");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormTitle (PT_FormEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"FormTitle",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectByFormTitleLST (PT_FormEntity obj)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FormTitle"),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectByFormTitleLST (PT_FormEntity obj,SelectOptions option)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"FormTitle",option),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormTitle (string FormTitle )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormTitle = FormTitle;  
            return Adapter.SelectByField(obj,"FormTitle");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByFormTitle (string FormTitle, SelectOptions option)
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormTitle = FormTitle;  
            return Adapter.SelectByField(obj,"FormTitle",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_FormEntity> SelectByFormTitleLST (string FormTitle )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormTitle = FormTitle;  
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FormTitle"),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien FormTitle duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_FormEntity> SelectByFormTitleLST (string FormTitle, SelectOptions option)
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.FormTitle = FormTitle;  
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"FormTitle",option),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (PT_FormEntity obj)
        { 
            return Adapter.SelectByField(obj,"OrderIndex");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (PT_FormEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"OrderIndex",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectByOrderIndexLST (PT_FormEntity obj)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"OrderIndex"),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectByOrderIndexLST (PT_FormEntity obj,SelectOptions option)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"OrderIndex",option),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (int OrderIndex )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.OrderIndex = OrderIndex;  
            return Adapter.SelectByField(obj,"OrderIndex");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByOrderIndex (int OrderIndex, SelectOptions option)
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.OrderIndex = OrderIndex;  
            return Adapter.SelectByField(obj,"OrderIndex",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_FormEntity> SelectByOrderIndexLST (int OrderIndex )
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.OrderIndex = OrderIndex;  
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"OrderIndex"),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien OrderIndex duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<PT_FormEntity> SelectByOrderIndexLST (int OrderIndex, SelectOptions option)
        { 
            PT_FormEntity obj = new PT_FormEntity();
            obj.OrderIndex = OrderIndex;  
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"OrderIndex",option),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectWithConditionLST (PT_FormEntity obj)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new PT_FormEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<PT_FormEntity></returns>
        public List<PT_FormEntity> SelectWithConditionLST (PT_FormEntity obj,SelectOptions option)
        { 
            return  (List<PT_FormEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new PT_FormEntity());
        }

}
}
